<template>
    <div>
        <!-- <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-pie-chart"></i> 奖项统计
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
        </div> -->
        <div>
            <div id="myChart" :style="{width: '800px', height: '600px'}"></div>
        </div>
    </div>
</template>

<script>
import echarts from 'echarts'
import {selectAllAwards,selectList} from '@/api/classAwards.js';
export default {
    name: 'basecharts',
    data() {
        return {
            //查询参数
            // query: {
            //     userId:'',
            //     awardsId:null,
            //     classId: null,
            //     pageIndex: 1,
            //     pageSize: 100,
            // },
        };
    },
    
    created() {
        //this.getData();
    },
    mounted(){
        this.drawLine();
    },
    methods:{

        //获取列表数据
		//   getData(){            
        //     const userInfo = localStorage.getItem("userInfo");
        //     const user = JSON.parse(userInfo);
        //     this.query.userId = user.userId;
        //     const _this = this
        //     this.loading2 = true
        //     selectList(this.query).then((res)=>{
		// 	    console.log(res)
        //     }).catch((err) => {
		// 	        console.log('请求失败'+err)
		// 	    });

        //     this.loading2 = false;
        // },

        drawLine(){
        // 基于准备好的dom，初始化echarts实例
        let myChart = this.$echarts.init(document.getElementById('myChart'))
        // 绘制图表
        myChart.setOption({
            legend: {},
            tooltip: {},
            dataset: {
                source: [
                    ['product', '一等奖学金', '二等奖学金','优秀团支书', '三好学生','优秀学生干部','优秀团员'],
                    ['17计算机科学与技术', 1,1,10,10,0,0],
                    ['17电子信息工程', 0,0,0,10,0,0],
                    ['17软件工程', 0,0,10,1,0,0],
                    ['17信息管理与信息系统', 1,0,1,0,1,0]
                ]
            },
            xAxis: {type: 'category'},
            yAxis: {},
            series: [
                {type: 'bar'},
                {type: 'bar'},
                {type: 'bar'},
                {type: 'bar'},
                {type: 'bar'},
                {type: 'bar'}
            ]
                });
    },
    },

};
</script>

<style scoped>
.schart-box {
    display: inline-block;
    margin: 20px;
}
.schart {
    width: 600px;
    height: 400px;
}
.content-title {
    clear: both;
    font-weight: 400;
    line-height: 50px;
    margin: 10px 0;
    font-size: 22px;
    color: #1f2f3d;
}
</style>